package com.yipei.business.service;

import java.io.IOException;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yipei.business.domain.MlPositionShare;
import com.yipei.business.domain.MlTradeDealOrder;
import com.yipei.business.domain.MlTradeEntrustOrder;
import com.yipei.business.domain.MlTradingGroup;
import com.yipei.business.vo.EntrustOrderVo;
import com.yipei.business.vo.PositionShareVo;
import com.yipei.common.core.domain.AjaxResult;
import com.yipei.common.core.domain.entity.MlTradeAccount;

/**
 * 交易群主Service接口
 *
 * @author yipei
 * @date 2025-06-25
 */
public interface IMlTradingGroupService extends IService<MlTradingGroup>
{
    /**
     * 查询交易群主
     *
     * @param id 交易群主主键
     * @return 交易群主
     */
    public MlTradingGroup selectMlTradingGroupById(Long id);

    /**
     * 查询交易群主列表
     *
     * @param mlTradingGroup 交易群主
     * @return 交易群主集合
     */
    public List<MlTradingGroup> selectMlTradingGroupList(MlTradingGroup mlTradingGroup);

    /**
     * 新增交易群主
     *
     * @param mlTradingGroup 交易群主
     * @return 结果
     */
    public int insertMlTradingGroup(MlTradingGroup mlTradingGroup);

    /**
     * 修改交易群主
     *
     * @param mlTradingGroup 交易群主
     * @return 结果
     */
    public int updateMlTradingGroup(MlTradingGroup mlTradingGroup);

    /**
     * 批量删除交易群主
     *
     * @param ids 需要删除的交易群主主键集合
     * @return 结果
     */
    public int deleteMlTradingGroupByIds(Long[] ids);

    /**
     * 删除交易群主信息
     *
     * @param id 交易群主主键
     * @return 结果
     */
    public int deleteMlTradingGroupById(Long id);

    int addGroupUser(MlTradingGroup mlTradingGroup);

    void createpositionShareData(List<PositionShareVo> positionShareVoList, List<MlPositionShare> mlPositionShares, MlTradeAccount one) throws IOException;

    AjaxResult addEntrustOrderGroup(EntrustOrderVo entrustOrderVo) throws Exception;
    List<MlTradeDealOrder> splitRecursively(MlTradeDealOrder mlTradeDealOrder);

    void splitInternal(MlTradeDealOrder mlTradeDealOrder, List<MlTradeDealOrder> result);
}
